int brush_force(char *pattern, char *text)
{
  int m = strlen(pattern);
  int n = strlen(text);
  int i;
  
  for (i = 0; i < n - m + 1; ++i)
  {
    if (text[i] == pattern[0])
    {
      int j = 0;
      while (text[i + j] == pattern[j])
      {
        ++j;
        if (j == m)
        {
          return i;
        }
      }
    }
  }
  return -1;
}

